package com.cy.pj.sys.dao.impl;

import com.cy.pj.sys.dao.SysNoticeDao;
import com.cy.pj.sys.pojo.SysNotice;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @DATE:2021/3/10 10:10
 * @Author: LuckyH
 */
@Repository
public class SysNoticeDaoImpl implements SysNoticeDao {
    @Autowired
    private SqlSession sqlSession;

    @Override
    public List<SysNotice> selectNotices(SysNotice notice) {
        // 自动化扫描
        String interfacename = this.getClass().getInterfaces()[0].getName();
        String statement = "com.cy.pj.sys.dao.SysNotiiceDao.selectNotices";

        // 获取当前线程的方法栈 【1】为当前方法
        String elementId = Thread.currentThread().getStackTrace()[1].getMethodName();
        List<SysNotice> list = sqlSession.selectList(statement, notice);

        return list;

    }

    @Override
    public int deleteById(Long... id) {
        return 0;
    }

    @Override
    public SysNotice selectById(Long id) {
        return null;
    }

    @Override
    public int insertNotice(SysNotice notice) {
        return 0;
    }

    @Override
    public int updateNotice(SysNotice notice) {
        return 0;
    }
}
